<%@ include file="/common/taglibs.jsp"%>
<%@ taglib tagdir="/WEB-INF/tags/other" prefix="other"%>

<div class="data">
	<form class="mainForm" name="appAdminListForm"  id="appAdminListForm" method="post" action="${ctxPath}/system/appAdmin.html">
	<div class="top clearfix">
		<ul class="tab">
			<li <c:if test="${empty appAdminSearchCriteria.role}">class="curr"</c:if>><span><a href="javascript:void(0)" onclick="searchAppAdmins(true,{role:''})"><fmt:message key="appAdminList.all"/></a></span></li>
			<c:forEach var="role" items="${allRoles}" varStatus="status">
				<li <c:if test="${appAdminSearchCriteria.role == role.roleName}">class="curr"</c:if>>
					<span><a href="javascript:void(0)" onclick="searchAppAdmins(true,{role:'${role.roleName}'})">${role.roleName}</a></span>
				</li>
			</c:forEach>
		</ul>
		<%@include file="/common/pagingOnlyTop.jsp"%>
	</div>
	<c:set var="checkAll">
		<input type="checkbox" name="allbox" onclick="checkAll(this.form)" style="margin: 0 0 0 0px" />
	</c:set>
	
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table">	
			<tr>
			  	<th width="20"><input onclick="checkAll(this.form)" name="allbox" type="checkbox" value="" /></th>	
				<th style="width:10%" class='sortable ${(appAdminSearchCriteria.orderby eq 5)?"sorted order1":((appAdminSearchCriteria.orderby eq 6)?"sorted order2":"")}'>	
					<a onclick="sortField(this,5,6)"><fmt:message key="appUser.username" /></a>
				</th>
				<th style="width:8%" class='sortable ${(appAdminSearchCriteria.orderby eq 3)?"sorted order1":((appAdminSearchCriteria.orderby eq 4)?"sorted order2":"")}'>	
					<a onclick="sortField(this,3,4)"><fmt:message key="appAdmin.firstname" /></a>
				</th>
				<th>
					<fmt:message key="appAdmin.roles" />
				</th>
				<th style="width:12%" class='sortable ${(appAdminSearchCriteria.orderby eq 1)?"sorted order1":((appAdminSearchCriteria.orderby eq 2)?"sorted order2":"")}'>		
					<a onclick="sortField(this,1,2)"><fmt:message key="appUser.createTime" /></a>
				</th>
				<th style="width:8%"  class='sortable ${(appAdminSearchCriteria.orderby eq 7)?"sorted order1":((appAdminSearchCriteria.orderby eq 8)?"sorted order2":"")}'>	
					<a onclick="sortField(this,7,8)"><fmt:message key="appUser.status" /></a>
				</th>
				<th style="width:7%" >
					<fmt:message key="public.management" />
				</th>
			</tr>
			<c:forEach  items="${appAdminList}" var="appAdminItem" varStatus="status">
				<tr  class="${(status.index%2==0)?'even':'odd'}">
					<td>
	    				<c:if test="${!appAdminItem.isSuperAdmin}">
						    <input type="checkbox" name="multiIds" value="${appAdminItem.appuserId}" title="${appAdminItem.username}" class="checkbox" />
						</c:if>
						<input type="hidden" name="appuserId" value="${appAdminItem.appuserId}"/>
					</td>
					<td>
						<a href="javascript:void(0)" onclick="parent.editAppAdmin(${appAdminItem.appuserId})">
							${appAdminItem.username}
						</a>	
					</td>
					<td>
						${appAdminItem.firstname}
					</td>
					<td>
						<system:roles appAdmin="${appAdminItem}"/> 
					</td>
					<td>
						<common:datetimeFormat date="${appAdminItem.createTime}"/>
					</td>
					<td>
						<c:choose>
							<c:when test="${appAdminItem.isSuperAdmin}">
								<other:statusCheckBox id="status${status.index}" name="status" disabled="true" value="${appAdminItem.status}"/>
							</c:when>
							<c:otherwise>
								<other:statusCheckBox id="status${status.index}" name="status" value="${appAdminItem.status}"/>
							</c:otherwise>
				        </c:choose>
					</td>
					<td>
						<span class="resetPw"></span><a href="javascript:dlgresetPasswordDialog_show({appuserId:${appAdminItem.appuserId}})"><fmt:message key="appUser.password.reset.title"/></a>
					</td>
			</c:forEach>
			<c:if test="${empty appAdminList}">
				<tr>
					<td colspan="10" style="text-align:center">
						<fmt:message key="list.empty"/>
					</td>
				</tr>
			</c:if>
	</table>	
	
	<%@include file="/common/pagingOnly.jsp"%>
	</form>
</div>

<%--------保存查询条件 -------%>
<%@include file="appAdminSearchCriteriaStorage.jspf"%>

<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("appAdminItem");
});
</script>
